const fs = require('fs-extra');
const path = require('path');
const { initConfig, generateHock } = require('./lib/index');

const filePath = path.join(__dirname, 'snippets-config.json');
const existsFile = fs.existsSync(filePath);

if (existsFile) {
  initConfig(filePath, __dirname);

  async function init() {
    generateHock();
    // await syncHock();
    // const diffs = diff();
    // diffs.map(item => {
    //   console.log(item.origins);
    //   const list = item.list;
    //   list.map(el => {
    //     console.log(`${el.label} ${el.description}`);
    //   })
    // });
    // if (diffs.length === 0) {
    //   console.log(`暂无更新接口`);
    // }
  }

  init();
}